package com.zjc.stock;

import com.zjc.stock.calculator.StockTransactionFeeCalculator;
import com.zjc.stock.model.Account;
import com.zjc.stock.model.FeeDetail;

/**
 * 证券交易所
 */
public class StockExchange {
    public static Double minCommission = 5.0;   // 最低佣金（默认5元）
    public static Double stampTaxRate = 0.0005;    // 印花税率（默认0.0005）
    public static Integer SINGLE_STROKE = 100; // 一手100股


    public static Account account; // 当前账户

    public static FeeDetail sell(double mount, double price) {
        StockTransactionFeeCalculator sell = new StockTransactionFeeCalculator(account, TransactionType.SELL, mount * price);
        return sell.feeDetails();
    }

    public static FeeDetail buy(double mount, double price) {
        StockTransactionFeeCalculator sell = new StockTransactionFeeCalculator(account, TransactionType.BUY, mount * price);
        return sell.feeDetails();
    }



}
